package com.fastshopping.mall.controller;

import com.fastshopping.mall.service.MallService;
import com.fastshopping.order.pojo.Model;
import com.wink.entity.Result;
import com.wink.entity.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Name: 李袁勇
 * @Date: 2020/6/6 18:53
 * @Version: 1.0
 **/


/*
* 素材商城*/
@RequestMapping("/mall")
@RestController
public class MallController {
    @Autowired
    private MallService mallService;

    @RequestMapping("/findAllMall")
    public Result findAllMall(int user_id){
        try {
            List <Model> allMall = mallService.findAllMall(user_id);
            return new Result(true, StatusCode.OK,"成功",allMall);
        } catch (Exception e) {
            e.printStackTrace();
            return new Result(false,StatusCode.ERROR,"失败");
        }
    }
}
